home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 25 / CU Amiga Magazine's Super CD-ROM 25 (1998)(EMAP Images)(GB)(Track 1 of 2)[!][issue 1998-08].iso / CUCD / Programming / QuakeTools / src / libqdisplay / poly.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-06-09  |  2.1 KB  |  69 lines

  1. #ifndef POLY_H
  2. #define POLY_H
  3. #include "clippoly.h"
  4.  
  5.    /*
  6.     * I think this is the best point to implement an _effective_ cache
  7.     * the brute force method fills in an array of "struct cachedface *faceCache[numfaces][MIPMAP_MAX]"
  8.     * next step: the definition of an cacheface holds the different mip-sizes
  9.     */
  10.  
  11.     struct bitmap {
  12.       short int width, height;            //
  13.       int size;                    //
  14.       unsigned char *data;            //
  15.     };
  16.     
  17.     struct bitdim {
  18.       short int width, height;            //
  19.       int size;                    //
  20.     };
  21.     
  22.     struct faceextent {
  23.       int u0, u1;                // u0 is also the u for texture-gradients (except water/sky/..)
  24.       int v0, v1;                // v0 is also the v for texture-gradients (except water/sky/..)
  25.       int u10, v10;
  26.     };
  27.     
  28.     struct textgradient {
  29.       float u, v;                // same as u0/v0 or 0 subtracted by vec[j][3]
  30.       vec3_t uv0, uv1;                // 
  31.       vec3_t scaled;
  32.       struct dplane_t *plane;            // textures plane
  33.     };
  34.     
  35.     struct fastmipmap {
  36.       struct bitmap rawBody;
  37.       struct bitdim newBody;
  38.       int step, shift, row;
  39.       int y, x0;
  40.       double rescale;                // (8 >> mip) / 8.0
  41.     };
  42.     
  43.     struct texture {
  44.       bool texChanged;                // interface to dynamic changing and updating
  45.       short int lastMip;            // 
  46.     
  47.       short int textureType;            // the type of texture (constant)
  48.       struct fastmipmap mipMaps[MIPMAP_MAX];    // four sizes and four pointer to the textures (allmost constant, except for animating textures)
  49.  
  50.       short int *lightSString[MAXLIGHTMAPS];    // the type of lighting (points directly into the lightstringtable)
  51.       short int lightSLength[MAXLIGHTMAPS];    // the type of lighting (points directly into the lightlengthtable)
  52.       struct bitmap lightmap;            // the buffer for holding the lightmap (constant size)
  53.       unsigned char *lightdata;            // the raw lightmap
  54.  
  55.       struct faceextent faceExtent;
  56.       struct textgradient textGradient;
  57.  
  58.       unsigned char *tiled;            // the buffer for holding the temporary datas
  59.     };
  60.  
  61.    /*
  62.     */
  63.  
  64. void draw_face(__memBase, int face);
  65. void setup_default_point_list(void);
  66. void InitFaceCache(__memBase);
  67.  
  68. #endif
  69.